<acronym title="ECMAScript for XML">E4X</acronym> is a powerful way to process XML data with JavaScript.
You can read more about it here:
<ul>
  <li><a href="http://en.wikipedia.org/wiki/ECMAScript_for_XML">ECMAScript for XML at Wikipedia</a></li>
  <li><a href="https://developer.mozilla.org/Special:Tags?tag=E4X&amp;language=en">E4X tags at Mozilla Developer</a></li>
  <li><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Processing_XML_with_E4X">Processing XML with E4X</a></li>
</ul>

<h3>Finding XML content</h3>

Given this JavaScript E4X fragment...
<pre>
var pets =
&lt;pets&gt;
  &lt;domestic&gt;
    &lt;pet animal="dog"&gt;&lt;name&gt;Jasper&lt;/name&gt;&lt;age&gt;13&lt;/age&gt;&lt;/pet&gt;
    &lt;pet animal="cat"&gt;&lt;name&gt;Rupert&lt;/name&gt;&lt;age&gt;12&lt;/age&gt;&lt;/pet&gt;
    &lt;pet animal="cat"&gt;&lt;name&gt;Monty&lt;/name&gt;&lt;age&gt;15&lt;/age&gt;&lt;/pet&gt;
    &lt;pet animal="cat"&gt;&lt;name&gt;Tiger&lt;/name&gt;&lt;age&gt;20&lt;/age&gt;&lt;/pet&gt;
  &lt;/domestic&gt;
&lt;/pets&gt;
</pre>
...you can find the pet cats with this code:
<pre>
header('-type', 'text/plain');

var cats = pets.domestic.pet.(@animal=='cat');
write('There are ' + cats.length() + ' cats');
write('\n'); // newline

var monty = pets.domestic.pet.(name.toLowerCase()=="monty");
write('Monty is ' + monty.age + ' years old');
write('\n'); // newline

var tiger = pets.domestic.pet[3];
write('Tiger is ' + tiger.age + ' years old');
</pre>
...which will output:
<pre>
There are 3 cats
Monty is 15 years old
Tiger is 20 years old
</pre>
